<!--
 * @Description: 
 * @Version: 2.0
 * @Autor: wsh
 * @Date: 2024-01-31 16:01:08
 * @LastEditors: uphldjx 1373577124@qq.com
 * @LastEditTime: 2024-07-12 14:26:11
-->
<template>
	<div>
		<div class="report">
			<div class="designation">
				<h1>{{ nowRowData.subsidyProjectName }}</h1>
				<el-tag style="margin-left: 20px">{{ nowRowData.areaName }}</el-tag>
			</div>
			<h3 class="way">{{ nowRowData.subsidyTypeLabel }}</h3>
		</div>

		<el-button type="primary" @click="printHtml('no-print')" class="stamp">打印</el-button>
		<BaseContainer id="no-print">
			<aplid-base-crud ref="crud" class="w-100" :key="keyAssignments" :paramsObj="nowRowData" v-bind="baseConfig">
				<template #DetialDialog="{ row }">
					<!-- <firstApplyReport v-bind="fristApplyConfig"></firstApplyReport> -->
					<firstApplyReport v-bind="getApplyConfig(row)"></firstApplyReport>
				</template>
			</aplid-base-crud>
		</BaseContainer>
	</div>
</template>

<script setup lang="ts">
import { baseConfig } from './config'
import { printHtml } from '@/utils/print'
import apiMod from '@/apiMod/index'
import firstApplyReport from '../firstApplyReport/index.vue'

type Props = {
	nowRowData?: any
}
let props = withDefaults(defineProps<Props>(), {
	nowRowData: {},
})

let keyAssignments: any = ref(0)
const getApplyConfig = (row) => {
	return {
		creditCode: row.creditCode,
		belongDate: row.belongDate,
		subsidyProjectId: row.subsidyProjectId,
		applyNo: row.applyNo,
		fromId: row.applyNo,
		workflowRandom: row.workflowRandom,
		organizationId: row.organizationId,
		tableRel: row.tableRel,
	}
}
</script>

<style scoped lang="scss">
.report {
	display: flex;

	flex-direction: column;

	.designation {
		flex: 1;
		text-align: center;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.way {
		flex: 1;
		text-align: center;
	}
}

.stamp {
	float: right;
	margin-right: 50px;
}
</style>
